<?php
/*
 * @Author: your name
 * @Date: 2020-12-23 12:01:16
 * @LastEditTime: 2020-12-28 10:15:46
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: /special/application/common/service/asset_manage/service_provider/HostServiceHistory.php
 */

namespace app\common\service\asset_manage\service_provider;


use app\common\service\BaseService;
use think\Db;

class HostServiceHistory extends BaseService
{

    public function list($serviceId)
    {
        $field = 'id,content,start_time,end_time,option_time';
        //查询服务历史数据
        $data = Db::name('host_service_history')->field($field)
            ->where('service_id',$serviceId)
            ->order('id desc')
            ->paginate()->toArray();


        $data['count'] = $data['total'];

        return $data;
    }
    /**
     * @name 添加
     * @param $addData
     * @return int|string
     * @author wx
     * @date 2019/10/24 10:38
     */
    public function add($addData)
    {
        return Db::name('host_service_history')->insert($addData);
    }

    /**
     * @name 删除
     * @param $condition
     * @return int
     * @author wx
     * @date 2019/10/24 13:45
     */
    public function del($condition)
    {
        return Db::name('host_service_history')->where($condition)->delete();
    }

}